<template>
  <div class="customer">
    <div class="top111">
      <img @click="fanhui" src="../assets/总图标包含整个系统的/fanhui.png" />
      <span>客户列表信息</span>
      <p @click="myclick">新增</p>
    </div>
    <van-search
      v-model="value"
      shape="round"
      background="#ffffff"
      placeholder="客户名称/联系方式"
      :show-action="right"
      action-text="搜索"
    />
    <div class="content">
      <div class="box" v-for="(itme, index) in arr" :key="index">
        <div class="box_t" @click="clicka(itme.id)">
          <p><span>客户名字</span>{{ itme.custName }}</p>
          <p><span>联系方式</span>{{ itme.telephone }}</p>
          <p><span>公司名称</span>{{ itme.company }}</p>
          <p><span>职务</span>{{ itme.position || "普工" }}</p>
        </div>
        <div class="box_b">
          <div class="btn" @click="newbf">新增拜访</div>
          <div class="btn" @click="record">拜访记录</div>
        </div>
      </div>
    </div>
    <!-- <div class="sdafsdf"> -->
    <div class="bottom" @click="sdfsd">点击展开更多</div>
    <!-- </div> -->
  </div>
</template>
 
<script>
import { GetKehuCourierList } from "../request/aip";
export default {
  data() {
    return {
      value: "",
      right: true,
      //   总数据数组内容
      arr: [],
      num: 3,
    };
  },
  methods: {
    fanhui() {
      this.$router.go(-1);
    },
    clicka(id) {
      this.$router.push({ name: "CustomerlistZ", params: { id } });
    },
    sdfsd() {
      this.num += 3;
      GetKehuCourierList({
        current: 1,
        size: this.num,
      }).then((res) => {
        // console.log(res);
        this.arr = res.data.records;
      });
    },
    myclick() {
      this.$router.push("/customerlistX");
    },
    newbf() {
      this.$router.push("/customeradd");
    },
    // 拜访记录
    record() {
      this.$router.push("/customerrecord");
    },
  },
  created() {
    this.num = 3;
    GetKehuCourierList({
      current: 1,
      size: this.num,
    }).then((res) => {
      //   console.log(res);
      this.arr = res.data.records;
    });
  },
};
</script>
 
<style lang = "less" scoped>
.customer {
  width: 100vw;
  height: 100vh;
  background-color: #f5f5f5;
}
.top111 {
  background-color: #023293;
  display: flex;
  justify-content: space-between;
  color: #fff;
  align-items: center;
  padding: 10px;
  img {
    width: 10px;
  }
}

.box {
  margin-top: 10px;
  padding: 0 20px;
  background-color: #fff;
  .box_t {
    p {
      margin-bottom: 4px;
      font-size: 14px;
      span {
        margin-right: 10px;
        color: rgb(155, 143, 143);
        font-size: 14px;
      }
    }
  }
  .box_b {
    display: flex;
    padding: 10px 0;
    text-align: center;
    border-top: 1px solid rgb(218, 208, 208);
    justify-content: flex-end;
    .btn {
      background-color: #003399;
      color: #fff;
      padding: 5px 15px;
      border-radius: 30px;
      margin-left: 10px;
    }
  }
}
.bottom {
  background-color: #fff;
  text-align: center;
  color: #003399;
  width: 100%;
  margin-top: 20px;
  padding: 10px;
  position: fixed;
  left: 0;
  bottom: 0;
}
</style>